<!DOCTYPE html>
<html>
  <head>
    <title>Logbot | #<%= @channel %></title>
    <link rel="stylesheet" type="text/css" href="/assets/widget.css">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ropa+Sans">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono">
    <base target="_blank" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  </head>
  <body>
    <div class="wrapper">
      <div class="header">
        <h1>Logbot <span class="channel">#<%= @channel %></span></h1>
      </div>
      <div class="body">
        <div>
          <ul class="logs">
            <% @msgs.each do |msg| %>
              <% linked_msg = msg["msg"].gsub(/http[s]*:\/\/[^\s]+/, '<a href="\0">\0</a>') %>
              <li>
                <span class="time"><%= Time.at(msg["time"].to_f).strftime("%T") %></span>
                <span class="nick"><%= msg["nick"] %></span>
                <span class="msg wordwrap"><%= linked_msg %></span>
              </li>
            <% end %>
          </ul>
        </div>
      </div>
      <div class="footer">
        <p>Powered by Logbot 2013 | <a href="https://github.com/dannvix/Logbot">GitHub Repo</a></p>
      </div>
    </div>
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script>
      var channel = "<%= @channel %>";
    </script>
    <script src="/assets/applications.js"></script>
    <script>
      pollNewMsg(true);
    </script>
  </body>
</html>
